function formSubmit(form, redirectUrl)
{
    form.on('submit', function() {
        $.ajax({
            url: form.attr('action'),
            type: form.attr('method'),
            data: form.serialize(),
            success: function(result) {
                if(result.status == 1) {
                    window.location.href = redirectUrl;
                } else {
                    alert(result.msg);
                }
            },
            dataType: 'JSOn'
        });
        return false;
    });
}

function backTo()
{
    history.back();
}
